
import java.io.Serializable;

import javax.faces.bean.ManagedBean;

import org.primefaces.event.map.OverlaySelectEvent;
import org.primefaces.model.map.DefaultMapModel;
import org.primefaces.model.map.LatLng;
import org.primefaces.model.map.MapModel;
import org.primefaces.model.map.Marker;

@ManagedBean(name = "mapBean1")
public class MapBean1 implements Serializable {
	
	private MapModel advancedModel;

	private Marker marker;

	public MapBean1() {
		advancedModel = new DefaultMapModel();
		
		//Shared coordinates
		LatLng coord1 = new LatLng(41.3805437794449,2.123150492065406);
		
		
		//Icons and Data
		advancedModel.addOverlay(new Marker(coord1, "Estadio CampNou", "img/campnou.png", "http://maps.google.com/mapfiles/ms/micons/blue-dot.png"));
		
	}

	public MapModel getAdvancedModel() {
		return advancedModel;
	}
	
	public void onMarkerSelect(OverlaySelectEvent event) {
		marker = (Marker) event.getOverlay();
	}
	
	public Marker getMarker() {
		return marker;
	}
}
